//
//
// SHMLogAdapter.h
//

#ifndef _SHM_LOG_ADAPTER_H_
#define _SHM_LOG_ADAPTER_H_

#include "BaseLogAdapter.h"
#include "LogManager.h"
#include "SHMLogAdapterClient.h"

class SHMLogAdapter : public BaseLogAdapter
{
	public:
		
		SHMLogAdapter();
		~SHMLogAdapter();

		bool Open(key_t key);
		bool Close(void);
		virtual void Flush(void);

		virtual void Report(void);
		virtual bool Log(const std::string& info);
		virtual LogManager::ADAPTER_TYPE AdapterType(void);

	private:
		SHMLogAdapter(const SHMLogAdapter& other);
		SHMLogAdapter& operator=(const SHMLogAdapter& other);


		bool 				_bOpened;
		int 				_shmid;
		char*				_shm;		// map area start address

		ShmLogBufHeader* 	pHeader;
};
#endif // _SHM_LOG_ADAPTER_H_
